/*设计一个汽车类（需要知识点默认参数，内联函数，const函数）
有属性：车轮的数量(默认为4个)，车的品牌，价格
有函数：相关属性的get（getter使用const函数），
set函数，以及用于显示所有属性的内联函数*/
#include <iostream>
using namespace std;
#include <string>

class Car
{
private:
    int tyre;
    string brand;
    float price;
public:
    Car(string _brand,float _price,int _tyre = 4)
    {
        this->tyre = _tyre;
        this->brand = _brand;
        this->price = _price;
    }
    ~Car()
    {}

    //默认内联函数
    void setCar()
    {
        cout<<"brand:"<<endl;
        cin>>this->brand;
        cout<<"price:"<<endl;
        cin>>this->price;
        cout<<"tyre:"<<endl;
        cin>>this->tyre;
    }
    //默认内联函数
    void getCar()
    {
        cout<<"brand:"<<this->brand<<endl;
        cout<<"price:"<<this->price<<endl;
        cout<<"tyre:"<<this->tyre<<endl;
    }
};

int main(int argc,char*argv[])
{
    Car BMW("BMW",2000);
    BMW.getCar();
    BMW.setCar();
    BMW.getCar();
    return 0;
}
